package com.principle.observer.improve;

public class Baidu implements Observer{
    private float temperature;
    private float pressure;
    private float humidity;
    //更新天气情况，是由 WeatherData 来调用，使用推送模式
    public void update(float temperature,float pressure,float humidity){
        this.temperature=temperature;
        this.pressure=pressure;
        this.humidity=humidity;
        display();
    }
    public void display(){
        System.out.println("今天的温度是："+temperature);
        System.out.println("今天的气压是："+pressure);
        System.out.println("今天的湿度是："+humidity);
    }
}
